var PEOPLE_USER_ID;
	
$(document).ready(function () {	
	 bp_more_load(G_BASE_URL + '/people/ajax/user_actions/distint-1__uid-' + PEOPLE_USER_ID, $('#bp_user_actions_more'), $('#contents_user_actions'));	// 个人动态							
		 
	 $("#contents_user_actions_index").load(G_BASE_URL + '/people/ajax/user_actions/distint-1__perpage-5__uid-' + PEOPLE_USER_ID); 
		 
	 bp_more_load(G_BASE_URL + '/people/ajax/user_actions/get_type-questions__uid-' + PEOPLE_USER_ID + '__actions-201', $('#bp_user_actions_question_more'), $('#contents_user_actions_question'));	// 参与的问题	
		 
	  $("#contents_user_actions_question_index").load(G_BASE_URL + '/people/ajax/user_actions/get_type-questions__perpage-5__uid-' + PEOPLE_USER_ID + '__actions-201'); 
		  
	 bp_more_load(G_BASE_URL + '/people/ajax/user_actions/get_type-questions__uid-' + PEOPLE_USER_ID + '__actions-101', $('#bp_user_actions_question_more_101'), $('#contents_user_actions_question_101'));	// 发起的问题	

	$("#contents_user_actions_question_101_index").load(G_BASE_URL + '/people/ajax/user_actions/get_type-questions__perpage-5__uid-' + PEOPLE_USER_ID + '__actions-101'); 
 		 
	bp_more_load(G_BASE_URL + '/people/ajax/following/uid-' + PEOPLE_USER_ID, $('#bp_more_following'), $('#contents_following'));	// 我关注的人	
	bp_more_load(G_BASE_URL + '/people/ajax/followers/uid-' + PEOPLE_USER_ID, $('#bp_more_followers'), $('#contents_followers'));	// 关注我的人	
	bp_more_load(G_BASE_URL + '/people/ajax/topics/uid-' + PEOPLE_USER_ID, $('#bp_more_topics'), $('#contents_topics'));//我关注的话题
	
	$(function(){
		var JF_Elements = $('.tommy_rightDiv .default_As'),
			 el = {
				 //
				JF:function(){
					for(var i=0,len=6;++i<=len;){
						
						i <= 3 ? $('#block_'+i).removeClass('hide') : $('#block_'+i).addClass('hide');
						$(JF_Elements).eq(0).addClass('cur').parent().parent().find('.default_As').eq(i).removeClass('cur');
						i <= 3 ? $('#block_'+i+'b').addClass('hide') :false;
					}
					$('.all_answer').show();
				},
				EVE_handler:function(x){
					
					x == 0 ? el.JF() : el.through_ev(x);
				},
				
				//
				through_ev : function(x){
					el.el_callback(x);
				},
				ev_LoadFun : function(fn){
					
					$(JF_Elements).each(function(i) {
						$(this).click(function(){
							
							if (typeof fn == 'function'&& 
							    typeof fn != 'object'){
								fn(i);
							}
						});
					
					})
				},
				el_callback: function(x){
					$(JF_Elements).each(function(i) {
						
						$('#block_'+i+'b').addClass('hide')
						if (i >0 && i == x){
							$(JF_Elements).eq(x).addClass('cur');
							$('#block_'+x+'b').removeClass('hide');
							if (x >3){
								$('#block_'+x).removeClass('hide')
							}else{
								$('#block_'+i).addClass('hide');
							}
						}else{
							$('#block_'+i).addClass('hide');
							$('#block_'+i+'b').addClass('hide');
							$(JF_Elements).eq(x).parent().parent().find('.default_As').eq(i).removeClass('cur');
						}
					});
					$('.all_answer').hide();
				},
				el_click: function(x){
					var rel = $(x).attr('rel');
					$(JF_Elements).each(function(i) {
						
						$(JF_Elements).eq(rel).addClass('cur').parent().parent().find('.default_As').eq(i).removeClass('cur');
						$('#block_'+i).addClass('hide');
						$('#block_'+rel+'b').removeClass('hide').parent().find('#block_'+i+'b').addClass('hide');
						$('.all_answer').hide();
					});
				}
				
			};
			
		el.ev_LoadFun(el.EVE_handler);
		
		
		$('.all_answer').click(function(){
			el.el_click(this);
		});
		
		$('#particular').click(function(){
			el.el_callback(4);
		})
			
	});
});